package com.complaint.rest;

import com.complaint.rest.model.Complaint;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Created by Alex
 */
@XmlRootElement
@XmlSeeAlso(Complaint.class)
public class Complaints extends ArrayList<Complaint> {
    public Complaints() {
        super();
    }

    public Complaints(Collection<? extends Complaint> c) {
        super(c);
    }

    @XmlElement(name = "complaint")
    public List<Complaint> getComplaints() {
        return this;
    }

    public void setComplaints(List<Complaint> complaints) {
        this.addAll(complaints);
    }
}